/**
 * Bakalarska prace - Inteligentni budik
 * @package sleepCatcher
 * @file FormAlarmAwakeSound.h
 * @author Jan Pesava - xpesav00
 * @email xpesav00@stud.fit.vutbr.cz
 * @date 24. 12. 2011
 */

#ifndef FORMALARMAWAKESOUND_H_
#define FORMALARMAWAKESOUND_H_

#include <FBase.h>
#include <FUi.h>

#include "models/SCAlarm.h"

using namespace Osp::Base;
using namespace Osp::Ui::Controls;


class FormAlarmAwakeSound :
	public Osp::Ui::Controls::Form,
	public Osp::Ui::IActionEventListener,
	public Osp::Ui::Controls::IListViewItemEventListener,
	public Osp::Ui::Controls::IListViewItemProvider
{

// Construction
public:
	FormAlarmAwakeSound();
	virtual ~FormAlarmAwakeSound();

// Constants
	static const int IDA_SOUND_BACK 	= 200;
	static const int IDA_MY_SOUNDS 		= 201;
	static const int IDA_ALARM_SOUND 	= 202;
	static const int LIST_ITEM_NAME 	= 203;
	static const int LIST_ITEM_PLAY 	= 204;
// Attributes
	SCAlarm* pAlarm;
	ListView* pListViewSounds;
	ArrayList* pAlarmSounds;
// Methods
public:
	bool Initialize(void);
	virtual result OnInitializing(void);
	virtual result OnTerminating(void);
	virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId);
	virtual void OnListViewContextItemStateChanged (Osp::Ui::Controls::ListView &listView, int index, int elementId, Osp::Ui::Controls::ListContextItemStatus status);
	virtual void OnListViewItemLongPressed (Osp::Ui::Controls::ListView &listView, int index, int elementId, bool &invokeListViewItemCallback);
	virtual void OnListViewItemStateChanged (Osp::Ui::Controls::ListView &listView, int index, int elementId, Osp::Ui::Controls::ListItemStatus status);
	virtual void OnListViewItemSwept (Osp::Ui::Controls::ListView &listView, int index, Osp::Ui::Controls::SweepDirection direction);
	virtual Osp::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
	virtual bool DeleteItem(int index, Osp::Ui::Controls::ListItemBase* pItem, int itemWidth);
	virtual int GetItemCount(void);
	void PrepareAlarmSound();
	void SetAlarm(SCAlarm* pAlarm);
	SCAlarm* GetAlarm();
	int GetFormId();
	void Update();
	void Redraw();
};

#endif /* FORMALARMAWAKESOUND_H_ */
